namespace Common {
    using System;

    public class JSONEncode {
        public static readonly string _DOUBLEQUOTATIONMARKS = "@doubleQuotationMarks";
        public static readonly string _LEFTBRACES = "@leftbraces";
        public static readonly string _LEFTBRACKETS = "@leftbrackets";
        public static readonly string _RIGHTBRACES = "@rightbraces";
        public static readonly string _RIGHTBRACKETS = "@rightbrackets";

        public static string StrDecodeForDeserialize(string text) {
            return text.Replace(_LEFTBRACES, "{").Replace(_RIGHTBRACES, "}").Replace(_LEFTBRACKETS, "[").Replace(_RIGHTBRACKETS, "]").Replace(_DOUBLEQUOTATIONMARKS, "\"");
        }

        public static string StrEncodeForDeserialize(string text) {
            return text.Replace("{", _LEFTBRACES).Replace("}", _RIGHTBRACES).Replace("[", _LEFTBRACKETS).Replace("]", _RIGHTBRACKETS).Replace("\"", _DOUBLEQUOTATIONMARKS);
        }
    }
}

